//
//  LBCommonModel.m
//  LandCredit
//
//  Created by 段新瑞 on 2019/9/30.
//  Copyright © 2019 Mr.Xr. All rights reserved.
//  mj_objectArrayWithKeyValuesArray

#import "XRCommonModel.h"

@implementation XRCommonModel

+ (instancetype)commonModelWithKeyValues:(id)keyValues dataClass:(Class)cls {
    // keyValues if always dictionary
    XRCommonModel *model = [XRCommonModel mj_objectWithKeyValues:keyValues];
    if (model.data && cls) {
        model.data = [cls mj_objectWithKeyValues:model.data];
    }
    return model;
}

+ (instancetype)commonModelWithKeyValues:(id)keyValues dataArrayClass:(Class)cls {
    XRCommonModel *model = [XRCommonModel mj_objectWithKeyValues:keyValues];
    if (model.data && cls) {
        model.data = [cls mj_objectArrayWithKeyValuesArray:model.data];
    }
    return model;
}

- (BOOL)isSuccess {
    return [self.success isEqualToString:@"1"];
}

@end
